<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <!-- 
    React的写法:
      <p style={{fontSize: '20px', backgrounColor: 'pink'}}>style动态绑定</p>
    Vue的写法:
      <p :style="{fontSize: '20px', 'backgroun-color': 'pink'}">style动态绑定</p>
   -->
  <div id="test">
    <p :style="{fontSize: mySize+'px', 'background-color': bgColor}">style动态绑定</p>
  </div>

  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#test",
      data: {
        mySize: 20,
        bgColor: 'pink'
      }
    })

    setTimeout(() => {
      vm.mySize = 30
      vm.bgColor = 'deeppink'
    }, 1000);
  </script>
</body>
</html>